export const toString = Object.prototype.toString;

export const isUndefined = (obj) => obj === void 0;

export const isNull = (obj) => obj === null;

export const isWindow = (obj) => obj && obj === obj.window;

export const isDocument = (obj) => obj && obj.nodeType === 9;

export const isArray = Array.isArray || ((object) => object instanceof Array);

for (const name of ['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error']) {
	exports[`is${name}`] = (obj) => toString.call(obj) === `[object ${name}]`;
}
